package com.edu.controller;
/*
 * @Author:princess
 * @Date 2023/11/13 11 13 19:34
 *
 */

import com.edu.service.BookService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@Controller
public class BookController {
    @Resource
    private BookService bookService;
    @RequestMapping("/showAllBook")
    public ModelAndView showAllBook(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("book.jsp");
        mv.addObject("books",bookService.selectAllBooks());
        return mv;
    }
}
